﻿# CMakeList.txt: CMakeProject1 的 CMake 项目，在此处包括源代码并定义
# 项目特定的逻辑。
#环境变量说明:
#CMAKE_SOURCE_DIR  工程顶层CMakeList.txt所在的目录
#_SOURCE_DIR： 指的是工程的顶级目录。
#PROJECT_SOURCE_DIR 指的子工程CMakeList.txt所在的目录
#PROJECT_BINARY_DIR 指执行 cmake的路径

cmake_minimum_required (VERSION 2.8)

set(prj tool)
# 项目信息  
project (${prj})

# include directories
INCLUDE_DIRECTORIES(system ./src/)
INCLUDE_DIRECTORIES(after  ${PROJECT_SOURCE_DIR}/../xlnt/include)


# lib directories
LINK_DIRECTORIES(
  #项目引用第三方库
 ${PROJECT_SOURCE_DIR}/../xlnt/out/build/x64-Debug/source
 ${PROJECT_SOURCE_DIR}/../xlnt/build/source  
)

set(SI_CXXFLAGS "-g3 -O3 -std=c++17 -Werror -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-variable -rdynamic -Wall -fPIC -DNDEBUG -DOS_LINUX -D__STDC_FORMAT_MACROS")
set(SI_CFLAGS "-g3 -O3 -rdynamic -Wall -fPIC -DNDEBUG -DOS_LINUX -D__STDC_FORMAT_MACROS")
 set(CMAKE_CXX_FLAGS ${SI_CXXFLAGS} CACHE INTERNAL "global cxx flags")
set(CMAKE_C_FLAGS ${SI_CFLAGS} CACHE INTERNAL "global c flags")

# 查找当前目录下的所有源文件
# 并将名称保存到 DIR_SRCS 变量
#file(GLOB_RECURSE SRCS2  ${PROJECT_SOURCE_DIR} "../com/*.cpp")
file(GLOB SRCS  ${PROJECT_SOURCE_DIR} "*.cpp")
# 指定生成目标
ADD_EXECUTABLE(${prj} ${SRCS})

SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/../bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/../lib)


target_link_libraries(
    ${prj}     
  #  xlntd.lib
  xlnt
)
# TODO: 如有需要，请添加测试并安装目标。
